-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add utilities for benchmarking different code versions #65
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pylintpython3 (reported by Codacy) found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
import sys | ||
|
||
def parse_args() -> tuple: | ||
path = sys.argv[2] |
Check warning
Code scanning / Prospector (reported by Codacy)
Unused variable 'path' (unused-variable) Warning test
|
||
return (flags, values) | ||
|
||
if sys.argv[1] == "-h" or sys.argv[1] == "--help" or len(sys.argv) < 3: |
Check warning
Code scanning / Prospector (reported by Codacy)
expected 2 blank lines after class or function definition, found 1 (E305) Warning test
# Checkout the repo | ||
os.system("mkdir -p " + clue_version) | ||
|
||
clone = subprocess.run(["git", |
Check warning
Code scanning / Prospector (reported by Codacy)
Using subprocess.run without explicitly set check is not recommended. (subprocess-run-check) Warning test
print("Compiling the Debug version of the library") | ||
os.chdir(f"{clue_version}/Debug") | ||
# Compile the debug version | ||
compile_debug = subprocess.run(["cmake", |
Check warning
Code scanning / Prospector (reported by Codacy)
Using subprocess.run without explicitly set check is not recommended. (subprocess-run-check) Warning test
print(f"Error: {compile_debug.stderr}") | ||
print("Failed to compile the debug version of the project") | ||
sys.exit(1) | ||
compile_debug = subprocess.run(["cmake", |
Check warning
Code scanning / Prospector (reported by Codacy)
Using subprocess.run without explicitly set check is not recommended. (subprocess-run-check) Warning test
@@ -0,0 +1,49 @@ | |||
|
|||
import matplotlib.pyplot as plt |
Check warning
Code scanning / Prospector (reported by Codacy)
Unable to import 'matplotlib.pyplot' (import-error) Warning
@@ -0,0 +1,49 @@ | |||
|
|||
import matplotlib.pyplot as plt | |||
import numpy as np |
Check warning
Code scanning / Prospector (reported by Codacy)
Unable to import 'numpy' (import-error) Warning
|
||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
import pandas as pd |
Check warning
Code scanning / Prospector (reported by Codacy)
Unable to import 'pandas' (import-error) Warning
import pandas as pd | ||
|
||
|
||
def generate_data(n_points: int, |
Check warning
Code scanning / Prospector (reported by Codacy)
Too many arguments (6/5) (too-many-arguments) Warning
size=(points_per_cluster, n_dim))) | ||
|
||
# concatenate clusters data | ||
data = np.concatenate([cl for cl in clusters]) |
Check warning
Code scanning / Prospector (reported by Codacy)
Unnecessary use of a comprehension (unnecessary-comprehension) Warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pylint (reported by Codacy) found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
#!/bin/python3 | ||
|
||
import os | ||
import subprocess |
Check notice
Code scanning / Bandit (reported by Codacy)
Consider possible security implications associated with subprocess module. Note test
|
||
repo_url = f"https://github.com/{fork}/CLUEstering.git" | ||
# Checkout the repo | ||
os.system("mkdir -p " + clue_version) |
Check notice
Code scanning / Bandit (reported by Codacy)
Starting a process with a shell, possible injection detected, security issue. Note test
# Checkout the repo | ||
os.system("mkdir -p " + clue_version) | ||
|
||
clone = subprocess.run(["git", |
Check notice
Code scanning / Bandit (reported by Codacy)
Starting a process with a partial executable path Note test
# Checkout the repo | ||
os.system("mkdir -p " + clue_version) | ||
|
||
clone = subprocess.run(["git", |
Check notice
Code scanning / Bandit (reported by Codacy)
subprocess call - check for execution of untrusted input. Note test
print((f"Failed to clone the repo {repo_url}. Check that the insersted repository," | ||
"commit or branch are correct")) | ||
sys.exit(1) | ||
os.system("cp -r " + |
Check notice
Code scanning / Bandit (reported by Codacy)
Starting a process with a shell, possible injection detected, security issue. Note test
print("Compiling the Release version of the library") | ||
os.chdir("../Release") | ||
# Compile the release version | ||
compile_release = subprocess.run(["cmake", |
Check notice
Code scanning / Bandit (reported by Codacy)
Starting a process with a partial executable path Note test
print(f"Error: {compile_release.stderr}") | ||
print("Failed to compile the release version of the project") | ||
sys.exit(1) | ||
compile_release = subprocess.run(["cmake", |
Check notice
Code scanning / Bandit (reported by Codacy)
subprocess call - check for execution of untrusted input. Note test
print(f"Error: {compile_release.stderr}") | ||
print("Failed to compile the release version of the project") | ||
sys.exit(1) | ||
compile_release = subprocess.run(["cmake", |
Check notice
Code scanning / Bandit (reported by Codacy)
Starting a process with a partial executable path Note test
"2"], | ||
capture_output=True, | ||
text=True) | ||
compile_release = subprocess.run(["cmake", |
Check notice
Code scanning / Bandit (reported by Codacy)
Starting a process with a partial executable path Note test
"2"], | ||
capture_output=True, | ||
text=True) | ||
compile_release = subprocess.run(["cmake", |
Check notice
Code scanning / Bandit (reported by Codacy)
subprocess call - check for execution of untrusted input. Note test
@@ -0,0 +1,3 @@ | |||
# |
Check warning
Code scanning / Shellcheck (reported by Codacy)
Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive. Warning test
@@ -0,0 +1,3 @@ | |||
# | |||
|
|||
perf stat -B -e cache-references,cache-misses,cycles,instructions,branches $1 |
Check notice
Code scanning / Shellcheck (reported by Codacy)
Double quote to prevent globbing and word splitting. Note test
This PR reworks the profiling scripts and provides a script for benchmarking execution time as a function of dataset size.
It also provides a python script for fetching specific versions of CLUEstering for comparison.